Skip to main content

HTML Guide

Bad value X for attribute “href” on element “a”: Illegal character in scheme data: “[” is not allowed.

The attribute value in the href on the <a> element contains invalid characters.

HTML links require a valid URL as the value of the href attribute. Brackets ([, ]) are not allowed in attribute values.

Example of invalid usage:

<a href="mailto:[user@example.com]">Email Us</a>

Correct usage:

<a href="mailto:user@example.com">Email Us</a>

If you are using a template variable to create the links, be sure the template engine properly outputs a valid address in the final HTML.

Example using pseudocode for a templating engine (replace with your syntax as needed):

<a href="mailto:{{ address }}">Email Us</a>

Correct, fully rendered HTML after the template variable is replaced:

<a href="mailto:user@example.com">Email Us</a>

Related W3C validator issues